<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class Images extends Model
{
    //
    protected $table="images";
    public $imagesModel;
    public function __construct()
    {
        $this->imagesModel = DB::table($this->table);
    }

    public function add($data){
        return $this->imagesModel->insertGetId($data);
    }
    public function findOne($params){
        return $this->imagesModel->where($params['where'])->select($params['field'])->first();
    }
}
